Obtain In-comming link information using history (createLink)

Hi,

I am trying to use the history mechanism in order to gather information of incomming links via createLink. I am able to grab out-going link information correctly using my history variable.
 

for h in o do {
   historyType = h.type
   if(historyType==createLink) {
       
       // get outgoing link info
       for l in o -> "*" do {
       LinkMod = module l
           println(h.targetAbsNo)
 
       }
      
   }
}

PatrickGuay - Thu Mar 15 08:52:06 EDT 2012

Re: Obtain In-comming link information using history (createLink)
PatrickGuay - Thu Mar 15 08:59:44 EDT 2012

Triggered the post of the message pre-maturely (my bad)
 

for h in o do {
   historyType = h.type
   if(historyType==createLink) {
       
       // get outgoing link info
       for l in o -> "*" do {
       LinkMod = module l
           println(h.targetAbsNo)
           println(goodStringOf(historyType))
       }
      
       //get Incomming link info
       for l2 in o2 <- "*" do {
            println(" DEBUG INCOMING SOURCE abs No : "  sourceAbsNo(l2) "")
            println(" DEBUG INCOMING TARGET abs No : "  targetAbsNo(l2) "")
            println(goodStringOf(historyType), 2)
       }
      
   }
}


In the first inner forloop (outgoing links) I am able to tap into the history object in order to grab targetAbsNo and a bunch of other history details. However, in order for me to grab incomming link information using the second inner for loop I have to supply the link as a paramter to sourceAbsNo and targetAbsNo since I am unable to grab the information from the history variable h.
As a last point goodStringOf(createLink) only displays "Create out-link". Is there something I am missing here? Are incomming links even stored in the history??

Any help is a DXL blessing. Thanks!

Re: Obtain In-comming link information using history (createLink)
Peter_Albert - Thu Mar 15 09:27:59 EDT 2012

PatrickGuay - Thu Mar 15 08:59:44 EDT 2012

Triggered the post of the message pre-maturely (my bad)
 

for h in o do {
   historyType = h.type
   if(historyType==createLink) {
       
       // get outgoing link info
       for l in o -> "*" do {
       LinkMod = module l
           println(h.targetAbsNo)
           println(goodStringOf(historyType))
       }
      
       //get Incomming link info
       for l2 in o2 <- "*" do {
            println(" DEBUG INCOMING SOURCE abs No : "  sourceAbsNo(l2) "")
            println(" DEBUG INCOMING TARGET abs No : "  targetAbsNo(l2) "")
            println(goodStringOf(historyType), 2)
       }
      
   }
}


In the first inner forloop (outgoing links) I am able to tap into the history object in order to grab targetAbsNo and a bunch of other history details. However, in order for me to grab incomming link information using the second inner for loop I have to supply the link as a paramter to sourceAbsNo and targetAbsNo since I am unable to grab the information from the history variable h.
As a last point goodStringOf(createLink) only displays "Create out-link". Is there something I am missing here? Are incomming links even stored in the history??

Any help is a DXL blessing. Thanks!

Links are stored in the source Module, hence their creation only triggers history records in the source Module. There is no history record in the target Module, as the target Module does not change at all when an incoming links is created from elsewhere.

Regards,

Peter

Re: Obtain In-comming link information using history (createLink)
PatrickGuay - Thu Mar 15 09:35:57 EDT 2012

Thanks for the confirmation, I think I will look for a work-around

Re: Obtain In-comming link information using history (createLink)
llandale - Fri Mar 16 12:35:25 EDT 2012

Albert is right. So you can plow through the incoming links, get a handle on the source object, then plow through the source object's history.

I don't think there is more information in that createLink history then there is in the Link itself. Since Links have attributes just like Objects and Modules, you could realistically ignore History do this:

Plow through incomming links
print (lnk."Created On") " by " (lnk."Created by") "\n"

-Louie